Page({
  data: {
    dateLayerVisible: false,
    houseLayerVisible: false,
    // 房屋列表
    houseList: [],
    houseId: '',
    // 房屋名称
    houseInfo: '',
    name: '',
    gender: 1,
    mobile: '',
    // 访客日期 从今天开始往后三天
    visitDate: ''
  },
  onLoad() {
    this.getHouseList()
  },
  // 封装真实 维修房屋 列表
  async getHouseList() {
    const res = await wx.http({
      url: '/house'
    })
    // console.log(28, res);
    this.setData({
      houseList: res.data
    })
  },
  // 选择报修房屋,选中某个值
  onRepairSelect(ev) {
    // console.log(30, ev);
    this.setData({
      houseInfo: ev.detail.name,
      houseId: ev.detail.id
    })
  },
  openHouseLayer() {
    this.setData({ houseLayerVisible: true })
  },
  closeHouseLayer() {
    this.setData({ houseLayerVisible: false })
  },
  openDateLayer() {
    this.setData({ dateLayerVisible: true })
  },
  closeDateLayer() {
    this.setData({ dateLayerVisible: false })
  },
  goPassport() {
    wx.reLaunch({
      url: '/visitor_pkg/pages/passport/index',
    })
  },
})
